<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>注册页面</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
</head>

<body>
<%

%>
	<form id="form1" name="form1" action="check2.jsp" method="post" onSubmit="return isValid(this);">
			<h2 style="color: cornflowerblue" align="center">请注册</h2>
			<table id="table2" align="center" style="background-color: burlywood;" width="350" height="400">
				<tr>
					<th align="right">账号：</th>
					<td><input type="text" name="name"  /></td>
				</tr>
				<tr>
					<th align="right">密码：</th>
					<td><input type="password" name="pwd"  /></td>
				</tr>
				<tr>
					<th align="right">确认密码：</th>
					<td><input type="password" name="pwd1"  /></td>
				</tr>
				<!-- <tr>
					<th align="right">手机号：</th>
					<td><input type="tel" name="tel" ></td>
				</tr>
				<tr>
					<th align="right">身份证号：</th>
					<td><input type="text" name="creditcard" ></td>
				</tr> -->
				<tr>
					<th>
					</th>
					<th align="left"><input type="button" id="inBtnSub" value="同意注册协议并确认" onclick="sub()" />
					<a href="checklogin.jsp"><font size="1">注册协议</font></a></th>
				</tr>
			</table>
			<script>
			function sub() {
				var user = document.getElementsByName("name")[0].value;
				if(user.length == 0 || user.length > 20) {
					alert("请输入正确的账号");
					return;
				} else if(document.getElementsByName("pwd")[0].value != document.getElementsByName("pwd1")[0].value) {
					alert("两次输入的密码不同");
					return;
				} 
				document.getElementById("form1").submit();
			}
		</script>
		</form>
</body>
</html>
